home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWODPart.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  10.4 KB  |  414 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWODPart.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWODPART_H
  11. #define FWODPART_H
  12.  
  13. /*
  14. #ifndef FWSTDDEF_H
  15. #include "FWStdDef.h"
  16. #endif
  17.  
  18. #ifndef FWEVENTH_H
  19. #include "FWEventH.h"
  20. #endif
  21.  
  22. #ifndef SOM_ODFModule_FW_SOMPart_xh
  23. #include "FWSOMPrt.xh"
  24. #endif
  25.  
  26. #ifndef FWIDLE_H
  27. #include "FWIdle.h"
  28. #endif
  29.  
  30. #ifndef FWPRTDEF_H
  31. #include "FWPrtDef.h"
  32. #endif
  33.  
  34. // ----- OS Includes -----
  35.  
  36. #ifndef FWWINDOW_H
  37. #include "FWWindow.h"
  38. #endif
  39.  
  40. #ifndef FWODMISS_H
  41. #include "FWODMiss.h"
  42. #endif
  43.  
  44. // ----- Foundation Includes -----
  45.  
  46. #ifndef FWRUNTYP_H
  47. #include "FWRunTyp.h"
  48. #endif
  49.  
  50. // ----- OpenDoc Includes -----
  51.  
  52. #ifndef SOM_ODPart_xh
  53. #include <Part.xh>
  54. #endif
  55.  
  56. #ifndef SOM_ODDraft_xh
  57. #include <Draft.xh>
  58. #endif
  59.  
  60. #ifndef SOM_ODDocument_xh
  61. #include <Document.xh>
  62. #endif
  63.  
  64. #ifndef SOM_ODStorageSystem_xh
  65. #include <ODStor.xh>
  66. #endif
  67.  
  68. #ifndef SOM_ODStorageUnit_xh
  69. #include <StorageU.xh>
  70. #endif
  71. */
  72.  
  73. #ifndef SOM_ODStorageUnitView_xh
  74. #include <SUView.xh>
  75. #endif
  76.  
  77. #ifndef SOM_ODCanvas_xh
  78. #include <Canvas.xh>
  79. #endif
  80.  
  81. #ifndef SOM_ODDragItemIterator_xh
  82. #include <DgItmIt.xh>
  83. #endif
  84.  
  85. #if FW_LIB_EXPORT_PRAGMAS
  86. #pragma lib_export on
  87. #endif
  88.  
  89. //========================================================================================
  90. //    Forward Declarations
  91. //========================================================================================
  92.  
  93. class FW_CLASS_ATTR ODFrame;
  94. class FW_CLASS_ATTR ODWindow;
  95. class FW_CLASS_ATTR ODSession;
  96. class FW_CLASS_ATTR ODTypeList;
  97. class FW_CLASS_ATTR ODLinkSource;
  98. class FW_CLASS_ATTR ODObjectSpec;
  99. class FW_CLASS_ATTR ODEmbeddedFramesIterator;
  100. class FW_CLASS_ATTR ODLink;
  101.  
  102. class FW_CLASS_ATTR FW_CPoint;
  103. class FW_CLASS_ATTR FW_CPart;
  104.  
  105. //========================================================================================
  106. //    class FW_CODPart
  107. //========================================================================================
  108.  
  109. class FW_CLASS_ATTR FW_CODPart
  110. {
  111. //----------------------------------------------------------------------------------------
  112. //    Initialization/Destruction
  113. //
  114. protected:
  115.     FW_CODPart() {}
  116.     ~FW_CODPart() {}
  117.  
  118. //----------------------------------------------------------------------------------------
  119. //    ODPart API
  120. //
  121. public:
  122.     //--------------------------------------------------------------------------
  123.     //    Initialization
  124.     
  125.     static void                InitPart(Environment *ev,
  126.                                     FW_CPart* part,
  127.                                     ODStorageUnit* storageUnit);
  128.  
  129.     static void                InitPartFromStorage(Environment *ev,
  130.                                     FW_CPart* part,
  131.                                     ODStorageUnit* storageUnit);
  132.  
  133.     //--------------------------------------------------------------------------
  134.     //    From Layout protocol
  135.  
  136.     static void                DisplayFrameAdded(Environment *ev,  
  137.                                 FW_CPart* part,
  138.                                 ODFrame* odFrame);
  139.  
  140.     static void                DisplayFrameRemoved(Environment *ev,  
  141.                                 ODFrame* odFrame);
  142.  
  143.     static void                DisplayFrameConnected(Environment *ev, 
  144.                                 ODFrame* odFrame);
  145.  
  146.     static void                DisplayFrameClosed(Environment *ev,  
  147.                                 ODFrame* odFrame);
  148.  
  149.     static void                AttachSourceFrame(Environment *ev,
  150.                                 ODFrame* odFrame,
  151.                                 ODFrame* odSourceFrame);
  152.  
  153.     static void                FrameShapeChanged(Environment *ev,  
  154.                                 ODFrame* odFrame);
  155.     
  156.     static void                ViewTypeChanged(Environment *ev,  
  157.                                 ODFrame* odFrame);
  158.  
  159.     static void                PresentationChanged(Environment *ev,  
  160.                                 ODFrame* odFrame);
  161.  
  162.     static void                SequenceChanged(Environment *ev,  
  163.                                 ODFrame* odFrame);
  164.     
  165.     static void                LinkStatusChanged(Environment *ev,  
  166.                                 FW_CPart* part,
  167.                                 ODFrame* odFrame);
  168.     
  169.     static void                ContainingPartPropertiesUpdated(Environment *ev,
  170.                                 ODFrame* odFrame,
  171.                                 ODStorageUnit* propertyUnit);
  172.  
  173.     static ODInfoType        ReadPartInfo(Environment *ev,
  174.                                 FW_CPart* part,
  175.                                 ODFrame* odFrame,
  176.                                 ODStorageUnitView* storageUnitView);
  177.  
  178.     static void                WritePartInfo(Environment *ev,
  179.                                 ODInfoType partInfo,
  180.                                 ODStorageUnitView* storageUnitView);
  181.  
  182.     static void                ClonePartInfo(Environment *ev,
  183.                                 ODDraftKey key,
  184.                                 ODInfoType partInfo,
  185.                                 ODStorageUnitView* storageUnitView,
  186.                                 ODFrame* scope);
  187.  
  188.     static ODID                Open(Environment *ev,  
  189.                                 FW_CPart* part,
  190.                                 ODFrame* odFrame);
  191.  
  192.     //--------------------------------------------------------------------------
  193.     //    From Imaging protocol
  194.  
  195.     static void                Draw(Environment *ev,
  196.                                 ODFacet* facet,
  197.                                 ODShape* invalidShape);
  198.  
  199.     static void                FacetAdded(Environment *ev,  
  200.                                 ODFacet* facet);
  201.  
  202.     static void                FacetRemoved(Environment *ev,  
  203.                                 ODFacet* facet);
  204.  
  205.     static void                GeometryChanged(Environment *ev,
  206.                                 ODFacet* facet,
  207.                                 FW_Boolean clipShapeChanged,
  208.                                 FW_Boolean externalTransformChanged);
  209.  
  210.     static void                HighlightChanged(Environment *ev,  
  211.                                 ODFacet* facet);
  212.  
  213.     static void                CanvasChanged(Environment *ev,  
  214.                                 ODFacet* facet);
  215.  
  216.     static void                CanvasUpdated(Environment *ev, 
  217.                                 ODCanvas* canvas);
  218.  
  219.     static unsigned long    GetPrintResolution(Environment *ev, 
  220.                                 ODFrame* odFrame);
  221.  
  222.     //--------------------------------------------------------------------------
  223.     // From Part Activation protocol
  224.  
  225.     static FW_Boolean         BeginRelinquishFocus(Environment *ev,
  226.                                 FW_CPart* part,
  227.                                 ODTypeToken focus,
  228.                                 ODFrame* odOwnerFrame,
  229.                                 ODFrame* proposedFrame);
  230.     
  231.     static void             CommitRelinquishFocus(Environment *ev,
  232.                                 ODTypeToken focus,
  233.                                 ODFrame* odOwnerFrame,
  234.                                 ODFrame* odProposedFrame);
  235.                   
  236.     static void             AbortRelinquishFocus(Environment *ev,
  237.                                 ODTypeToken focus,
  238.                                 ODFrame* ownerFrame,
  239.                                 ODFrame* proposedFrame);
  240.                       
  241.     static void                FocusAcquired(Environment *ev,
  242.                                 ODTypeToken focus,
  243.                                 ODFrame* ownerFrame);
  244.       
  245.     static void                FocusLost(Environment *ev,
  246.                                 ODTypeToken focus,
  247.                                 ODFrame* ownerFrame);
  248.           
  249.  
  250.     //--------------------------------------------------------------------------
  251.     // From Part Persistance protocol
  252.  
  253.     static void                ExternalizeKinds(Environment *ev, 
  254.                                 ODTypeList* kindset);
  255.     
  256.     static void                ChangeKind(Environment *ev, 
  257.                                 ODType kind);
  258.  
  259.     //--------------------------------------------------------------------------
  260.     // From UI Events protocol
  261.  
  262.     static FW_Boolean        HandleEvent(Environment *ev,
  263.                                 FW_CPart* part,
  264.                                 ODEventData* event,
  265.                                 ODFrame* odFrame,
  266.                                 ODFacet* odFacet,
  267.                                 ODEventInfo* eventInfo);
  268.   
  269.     static void                AdjustMenus(Environment *ev, 
  270.                                 FW_CPart* part,
  271.                                 ODFrame* odFrame);
  272.     
  273.     //--------------------------------------------------------------------------
  274.     // From Undo protocol
  275.  
  276.     static void                UndoAction(Environment *ev, 
  277.                                 FW_CPart* part,
  278.                                 ODActionData* actionState);
  279.     
  280.     static void                RedoAction(Environment *ev, 
  281.                                 ODActionData* actionState);
  282.     
  283.     static void                DisposeActionState(Environment *ev,
  284.                                 ODActionData* actionState,
  285.                                 ODDoneState doneState);
  286.     
  287.     static void                WriteActionState(Environment *ev,
  288.                                 ODActionData* actionState,
  289.                                 ODStorageUnitView* storageUnitView);
  290.     
  291.     static void                ReadActionState(Environment *ev, 
  292.                                 ODStorageUnitView* storageUnitView,
  293.                                 ODActionData* actionData);
  294.  
  295.     //--------------------------------------------------------------------------
  296.     // From DragAndDrop protocol
  297.  
  298.     static void                FulfillPromise(Environment *ev, 
  299.                                 FW_CPart* part, 
  300.                                 ODStorageUnitView* promiseSUView);
  301.     
  302.     static void                DropCompleted(Environment *ev,
  303.                                 ODPart* destPart,
  304.                                 ODDropResult dropResult);
  305.     
  306.     static ODDragResult        DragEnter(Environment *ev,
  307.                                 ODDragItemIterator* dragInfo,
  308.                                 ODFacet* facet,
  309.                                 const FW_CPoint& where);
  310.     
  311.     static ODDragResult        DragWithin(Environment *ev,
  312.                                 ODDragItemIterator* dragInfo,
  313.                                 ODFacet* facet,
  314.                                 const FW_CPoint& where);
  315.     
  316.     static void                DragLeave(Environment *ev,
  317.                                 ODFacet* facet,
  318.                                 const FW_CPoint& where);
  319.     
  320.     static ODDropResult        Drop(Environment *ev,
  321.                                 ODDragItemIterator* dropInfo,
  322.                                 ODFacet* facet,
  323.                                 const FW_CPoint& where);
  324.  
  325.     //--------------------------------------------------------------------------
  326.     // From Linking protocol
  327.  
  328.     static ODLinkSource*     CreateLink(Environment *ev, 
  329.                                 FW_CPart* part,
  330.                                 ODByteArray* data);
  331.     
  332.     static void                RevealLink(Environment *ev, 
  333.                                 FW_CPart* part,
  334.                                 ODLinkSource* linkSource);
  335.     
  336.     static void                LinkUpdated(Environment *ev,
  337.                                 FW_CPart* part, 
  338.                                 ODLink* updatedLink,
  339.                                 ODUpdateID updateID);
  340.     
  341.     // --- for containing parts ---
  342.     
  343.     static void                EmbeddedFrameUpdated(Environment *ev,
  344.                                 FW_CPart* part,
  345.                                 ODFrame* odFrame,
  346.                                 ODUpdateID updateID);
  347.     
  348.     static FW_Boolean        EditInLinkAttempted(Environment *ev, 
  349.                                 FW_CPart* part,
  350.                                 ODFrame* odFrame);
  351.  
  352.     //--------------------------------------------------------------------------
  353.     // From Embedding protocol
  354.  
  355.     static ODFrame*            RequestEmbeddedFrame(Environment *ev,
  356.                                 ODFrame* containingFrame,
  357.                                 ODFrame* baseFrame,
  358.                                 ODShape* frameShape,
  359.                                 ODPart* embeddedPart,
  360.                                 ODTypeToken viewType,
  361.                                 ODTypeToken presentation,
  362.                                 FW_Boolean isOverlaid);
  363.     
  364.     static void                RemoveEmbeddedFrame(Environment *ev,
  365.                                 ODFrame* embeddedFrame);
  366.     
  367.     static ODShape*            RequestFrameShape(Environment *ev,
  368.                                 ODFrame* embeddedFrame,
  369.                                 ODShape* frameShape);
  370.     
  371.     static void                UsedShapeChanged(Environment *ev,
  372.                                 ODFrame* embeddedFrame);
  373.     
  374.     static ODShape*            AdjustBorderShape(Environment *ev,
  375.                                 ODFacet* embeddedFacet,
  376.                                 ODShape* shape);
  377.  
  378.     static ODStorageUnit*    AcquireContainingPartProperties(Environment *ev, 
  379.                                 ODFrame* odFrame);
  380.  
  381.     static FW_Boolean        RevealFrame(Environment *ev,
  382.                                 ODFrame* embeddedFrame,
  383.                                 ODShape* revealShape);
  384.     
  385.     static void                EmbeddedFrameSpec(Environment *ev,
  386.                                 ODFrame* embeddedFrame,
  387.                                 ODObjectSpec* spec);
  388.     
  389.     //--------------------------------------------------------------------------
  390.     // Inherited ODPart API
  391.  
  392.     static void                Externalize(Environment *ev, FW_CPart* part);
  393.     static void             CloneInto(Environment *ev,
  394.                                 FW_CPart* part,
  395.                                 ODDraftKey key,
  396.                                 ODStorageUnit* toSU,
  397.                                 ODFrame* scope);
  398.  
  399.     static void                Release(Environment *ev, FW_CPart* part);
  400.     static void                ReleaseAll(Environment *ev, FW_CPart* part);
  401.     
  402.     static ODSize            Purge(Environment *ev, FW_CPart*, ODSize size);
  403.  
  404. };
  405.  
  406. #if FW_LIB_EXPORT_PRAGMAS
  407. #pragma lib_export off
  408. #endif
  409.  
  410. #endif
  411.  
  412.  
  413.  
  414.